package routers

import (
	"TodoProject/controller"
	"github.com/gin-gonic/gin"
)

func SetupRouter() (r *gin.Engine) {
	r = gin.Default()

	todoGroup := r.Group("pc/v1")
	{
		//查询todo列表
		todoGroup.GET("/todo", controller.GetTodoList)

		//增加todo一条数据
		todoGroup.POST("/todo", controller.CreateTodoItem)

		//修改指定id的todo项状态
		todoGroup.PUT("/todo/:id", controller.UpdateTodoItemStatusById)

		//删除指定todo项目
		todoGroup.DELETE("/todo/:id", controller.DeleteTodoItemById)

	}

	return
}
